const path = require('path')
const SkeletonWebpackPlugin = require('vue-skeleton-webpack-plugin');
const skeletonRouter = require('./src/skeleton/skeleton-router')
module.exports = {
    productionSourceMap: false,
    devServer: {
        disableHostCheck: true,
        overlay: {
            warnings: true,
            errors: true
        }
    },
    css: {
        // 使用 css 分离插件 mini-css-extract-plugin，不然骨架屏组件里的 <style> 不起作用，
        extract: true,
    },
    configureWebpack: (config)=>{
        // vue骨架屏插件配置
        config.plugins.push(new SkeletonWebpackPlugin({
          webpackConfig: {
            entry: {
              app: path.join(__dirname, './src/skeleton/skeleton.js'),
            },
          },
          minimize: true,
          quiet: true,
          router: {
              mode: 'history',
              routes: [
                {
                    path: '/demo1',
                    skeletonId: 'demo1'
                  },
                  {
                    path: '/demo2',
                    skeletonId: 'demo2'
                  }
              ]
          },
        }))
  },
}
